<?php
 include_once('dbConn.php');
 //连接数据库		
 connect();
//获取表单数据
$uname=$_POST["uname"];
$password=$_POST["password"];
//编写sql语句并执行
$sql="select * from users where uname='$uname' and password='$password'"; 
$rs=mysql_query($sql);
$num=mysql_num_rows($rs);
if($num>0) //登录成功，将当前用户的用户名写入session存储
{
   session_start();
   $_SESSION["user"]=$uname;
   echo "登录成功，0.1秒后跳转到主页";
   header("refresh:0.1;url='/final_project/foreground_system/lite/index.php'");
}
else{ 
echo "登录失败，1秒后返回登录页重新登录";
header("refresh:1;url='login.html'");
}
?>
